import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询出库明细单列表
export function listObDetails(query) {
    return request({
        url: '/wms/obDetails/list',
        method: 'get',
        params: query
    })
}

// 查询出库明细单详细
export function getObDetails(obDetailId) {
    return request({
        url: '/wms/obDetails/' + parseStrEmpty(obDetailId),
        method: 'get'
    })
}

// 新增出库明细单
export function addObDetails(data) {
    return request({
        url: '/wms/obDetails',
        method: 'post',
        data: data
    })
}

// 修改出库明细单
export function updateObDetails(data) {
    return request({
        url: '/wms/obDetails',
        method: 'put',
        data: data
    })
}

// 删除出库明细单
export function delObDetails(obDetailId) {
    return request({
        url: '/wms/obDetails/' + obDetailId,
        method: 'delete'
    })
}


// 出库手动配货
export function allocation(data) {
    return request({
        url: '/wms/obDetails/obManualAllot',
        method: 'post',
        data: data
    })
}
// 获取可配货库存
export function getAllocationStock(data) {
    return request({
        url: '/wms/stock/usableList',
        method: 'get',
        params: data
    })
}